var app = getApp();

Page({
    data: {
        activeIndex: 0,
        sliderOffset: 0,
        sliderLeft: 15,
        iszd: !1,
        refresh_top: !1,
        postlist: [],
        page: 1,
		url:''
    },
    onLoad: function(e) {
        var o = this;
        wx.setNavigationBarColor({
            frontColor: "#ffffff",
            backgroundColor: wx.getStorageSync("color"),
            animation: {
                duration: 0,
                timingFunc: "easeIn"
            }
        }), o.reload();
    },
    reload: function(e) {
        var c = this, t = wx.getStorageSync("users").id, i = wx.getStorageSync("url"), l = c.data.page, u = c.data.postlist;
        console.log(i), app.util.request({
            url: "entry/wxapp/MyRecruit",
            cachetime: "0",
            data: {
                user_id: t,
                pagesize: 10,
                page: l
            },
            success: function(e) {
                console.log(e), c.setData({
                    page: l + 1
                }), console.log(e), e.data.length < 10 ? c.setData({
                    refresh_top: !0
                }) : c.setData({
                    refresh_top: !1
                }), u = u.concat(e.data), console.log(u);
				for (var n in e.data) {
					e.data[n].logo = i + e.data[n].logo;
				}
				console.log(e.data);
                c.setData({
                    postlist: u,
                    slide: u,
					url:i
                });
            }
        });
    },
    see: function(e) {
        console.log(e), console.log(this.data);
        var t = this.data.slide, a = e.currentTarget.dataset.id;
        for (var o in t) if (t[o].id == a) var n = t[o];
        console.log(n), wx.navigateTo({
            url: "../resume/view?id=" + n.id,
            success: function(e) {},
            fail: function(e) {},
            complete: function(e) {}
        });
    },
    ormatDate: function(e) {
        var t = new Date(1e3 * e);
        return t.getFullYear() + "-" + a(t.getMonth() + 1, 2) + "-" + a(t.getDate(), 2) + " " + a(t.getHours(), 2) + ":" + a(t.getMinutes(), 2) + ":" + a(t.getSeconds(), 2);
        function a(e, t) {
            for (var a = "" + e, o = a.length, n = "", s = t; s-- > o; ) n += "0";
            return n + a;
        }
    },
    bianji: function(e) {
        console.log(e);
        var t = e.currentTarget.dataset.id;
        console.log(t), wx.navigateTo({
            url: "modify?id=" + t,
            success: function(e) {},
            fail: function(e) {},
            complete: function(e) {}
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        this.setData({
            activeIndex: 0,
            refresh_top: !1,
            postlist: [],
            page: 1
        }), this.reload(), wx.stopPullDownRefresh();
    },
    onReachBottom: function() {
        console.log("上拉加载", this.data.page), 0 == this.data.refresh_top && this.reload();
    },
    onShareAppMessage: function() {}
});